package org.uim.cricket.storage.raise;

import org.uim.cricket.db.impl.ExistGround;
import org.uim.cricket.entities.match.CricketMatch;
import org.uim.cricket.entities.match.Ground;
import org.uim.cricket.storage.Dlogger;
import org.uim.cricket.storage.StorageBeans;

public class CheckForGround {

	public String raiseGround(CricketMatch match, Ground g) throws Exception {
		ExistGround exist = new ExistGround(g.getId());
		boolean isexist = exist.exists();
		if (!isexist) {
			Dlogger.debug("  [New Ground]: #" + g.getId() + " - " + g.getName());
			return new InsertNewGround(StorageBeans.getInstance().fetchResObj(), match, g).raise();
		}
		return "";
	}
	
}
